using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using DAL;
using BUS;
using Entities;
using Utility;

public partial class Admin_TrangThaiDonHangUpdate : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {if(!IsPostBack )
    {
        LoadData();
    }

    }
    private void LoadData()
    {
        try
        {
            int id = int.Parse(Request.QueryString["id"].ToString());
            tbTTDonHang  ttdh = tbTTDonHangBus .GetByID(id);
            if (ttdh != null)
            {
                txt_mattdh .Text = ttdh.IDTTDonHang.ToString();
                txt_tenttdh.Text = ttdh.TrangThaiDH ;
            }
        }
        catch
        {
            Response.Redirect("~/Admin/TrangThaiDonHangList.aspx");
        }
    }
    protected void btlsp_update_Click(object sender, EventArgs e)
    {
        tbTTDonHang  ttdh = new tbTTDonHang ();
        ttdh .IDTTDonHang  = int.Parse(txt_mattdh.Text);
        ttdh .TrangThaiDH  = txt_tenttdh.Text;
        tbTTDonHangBus .Update(ttdh );
        Response.Redirect("~/Admin/TrangThaiDonHangList.aspx");
    }
}
